package com.zye.dao;

import com.zye.Util.JDBCUtils;
import com.zye.dao.UserDao;
import com.zye.entity.User;

import java.util.List;

public class UserDaoImpl implements UserDao {

    /**
     * 用户数据访问接口实现
     */


        @Override
        public User selectUserByUsername(String username) {
            List<User> users = JDBCUtils.query(User.class,
                    "select * from t_user where username = ?",username);
            if(users.size() > 0){
                return users.get(0);
            }
            return null;
        }
    }


